<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../node_modules/axios/dist/axios.js"></script>
</head>
<body>
<button>发送请求</button>
</body>
<script>
    const btn = document.querySelector("button");

    btn.onclick = function () {
        const one = axios.get("http://zhangpeiyue.com/scoreList", {params: {sex: "男"}});
        const two = axios.get("http://zhangpeiyue.com/scoreList", {params: {sex: "女"}});
        // axios.all([one, two]).then(axios.spread(function(res1,res2){
        //     console.log(res1.data,res2.data)
        // }))

        axios.all([one,two]).then(spread(function(res1,res2){
            console.log(res1,res2)
        }))
    }
    const spread = function(cb){
        return function(value){
            cb.apply(null,value)
        }
    }

</script>
</html>